<template>
  <!-- 教务管理-约名师-选课程 -->
  <div class="orderForeignTeacher-selectCourse">
    <div class="content-foreign-selectCourse">
      <div class="row" style="margin-top: 0;border-bottom: 0.01rem solid #f3ecec;height: 0.35rem;padding: 0 0;">
        <span class="title-top">{{courseObj.className}}</span>
      </div>
      <div class="row">
        <span class="color6">选择外教课程：</span>
        <span class="color3" style="margin-left:0.24rem;">{{courseObj.courseName}}</span>
      </div>
      <div class="row">
        <div class="clo-left">
          <span class="title-content">
            <span class="color6">可约名师课时总数：</span>
            <span class="color3">共{{courseObj.feiboSyllabusNum||(courseObj.syllabusEndNum-courseObj.syllabusStartNum+1)}}课次</span>
          </span>
          <el-input disabled v-model="courseObj.syllabusStartNum"></el-input>
        </div>
        <div class="clo-right">
          <span class="title-content color6">设置选课节数：</span>
          <el-input disabled class="input-aftertxt" style="width:2.7rem;" v-model="courseObj.syllabusEndNum"></el-input>
          <span class="color3" style="margin-left:0.07rem;">已选择：{{courseObj.syllabusStartNum}}-{{courseObj.syllabusEndNum}}课时</span>
        </div>
      </div>
      <div class="row">
        <!-- <span class="title-content" style="width:100%;">选择外教类型：</span>
        <div class="box-radio">
          <el-radio v-model="teacherCountry"  label="1">菲律宾老师</el-radio>
          <el-radio v-model="teacherCountry" label="2">欧美老师</el-radio>
        </div> -->
        <span class="txt-type color6">选择外教类型：</span>
        <span class="color3">{{courseObj.teacherCountry}}</span>
      </div>
      <div class="row">
        <!-- <span class="title-content" style="width:100%;">选择外教老师类型：</span>
        <div class="box-radio">
          <el-radio v-model="teacherType" label="1">专属和公共</el-radio>
          <el-radio v-model="teacherType" label="2">仅专属</el-radio>
        </div> -->
        <span class="txt-type color6">选择外教老师类型：</span>
        <span class="color3">{{courseObj.teacherType}}</span>
      </div>
      <div class="row">
          <span class="txt-type color6">支付类型：</span>
          <span class="color3">{{courseObj.payType}}</span>
      </div>
      <div class="row" style="margin-top:0.54rem;">
        <el-button class="resetElement" @click="selectCourseClick" type="primary" style="width:1.83rem;">确定选课</el-button>
      </div>
    </div>
    <el-dialog class="selectCourseSuccess"
     :modal="false"
     :visible.sync="selectCourseSuccessVisible"
     @close="cancel"
     >
      <div class="box-success">
        <div class="box-left">
          <i class="el-icon-success" style="font-size:0.6rem;color:rgb(0,255,0);"></i>
          <span>选课成功！</span>
        </div>
        <div class="splitline"></div>
        <div class="box-right">
          <span>选课班级：{{courseObj.className}}</span>
          <span>课程名称：{{courseObj.courseName}}</span>
          <span>已选课时：{{courseObj.syllabusStartNum}}-{{courseObj.syllabusEndNum}} 共{{courseObj.feiboSyllabusNum||(courseObj.syllabusEndNum-courseObj.syllabusStartNum+1)}}节课</span>
        </div>
        <div class="box-bottom">
          <el-button class="resetElement" @click="cancel" style="width:1.4rem;">取消</el-button>
          <el-button class="resetElement" style="margin-left:0.16rem;width:1.4rem;" @click="confirm">进入选名师</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props:['orderForeignTeacherSelectCourse'],
  data() {
    return {
      selectCourseSuccessVisible:false,
      teacherCountry:'1',
      teacherType:'1',
      setCouseseCount:'1',
      courseObj:{
        className:'',
        courseName:'',
        teacherCountry:'',
        syllabusStartNum:0,
        syllabusEndNum:0,
        teacherType:'专属和公共',
        payType:'余额支付'
      }
    };
  },
  methods: {
    /**初始化数据 */
    initBydata(data){
      if(!data)return;
      this._parentData=data;
      //班级信息
      let classObj=data.classObj;
      if(classObj)
      {  
        this.courseObj=classObj;
        this.courseObj.teacherCountry=tool.getDictNameByValue(classObj.foreignTeacherType,'foreign_teacher_type');
        this.courseObj.teacherType='专属和公共';
        this.courseObj.payType='余额支付';
      }
    },
    /**确认 */
    confirm(){

      this.$emit('confirm',this._parentData);
    },
    /**取消 */
    cancel(){
      this.$emit('cancel','data');
    },
    selectCourseClick(){
      this.selectCourseSuccessVisible=true;
    }
  },
  mounted() {
    
  },
  computed: {},
  watch: {},
  created: function() {}
};
</script>

<style lang="scss">
.orderForeignTeacher-selectCourse {
  width: 100%;
  padding: 0.16rem 0.3rem;
  background: #fff;
  border: 0.01rem solid #dcdfe6;
  border-radius: 0.1rem;
  -webkit-box-shadow: 0 0.02rem 0.38rem 0 #3885f81f, 0 0 0.06rem 0 #3885f81f;
  box-shadow: 0 0.02rem 0.38rem 0 #3885f81f, 0 0 0.06rem 0 #3885f81f;
  .content-foreign-selectCourse {
    // width: 50%;
    // margin-left: 25%;
    // padding: 0 0.04rem 0.2rem 0.04rem;
		font-size: 0.18rem;
    .color6{
      color: #666666;
    }
    .color3{
      color: #333333;
    }
    .title-top{
      font-size: 0.2rem;
      font-weight: bold;

    }
    .title-content{
      font-size: 0.18rem;
      display: block;
      margin-bottom: 0.05rem;
    }
    .row{
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      margin: 0.44rem 0;
      padding: 0 0.06rem;
      .clo-left{
        width: 3.88rem;
      }
      .clo-right{
        width: 6rem;
        margin-left: 0.32rem;
      }
      .box-radio{
        margin: 0.12rem 0;
      }
      .txt-type{
        width: 1.8rem;
      }
      .el-input__inner{
        font-size: 0.18rem !important;
        color: #333333 !important;
        height: 0.46rem !important;
        line-height: 0.46rem !important;
      }
      .input-aftertxt{
        .el-input__inner{
          padding-right: 0.5rem;
        }
      }
      .input-aftertxt:after{
        content: '节课';
        color: #333333;
        font-size: 0.18rem;
        position: absolute;
        width: 0.5rem;
        line-height: 0.46rem;
        right: 0;
      }
    }
    .el-radio{
      font-size: 0.16rem !important;
      .el-radio__label{
        font-size: 0.16rem !important;
      }
    }
    .el-button{
      font-size: 0.16rem !important;
    }
  }
  // 弹窗容器样式
  .selectCourseSuccess {
    // top: 0.81rem;
    // left: 2.1rem;
    background-color: rgba(0, 0, 0, 0.3);
    font-size: 0.16rem;
    .box-success{
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      span{
        font-size: 0.16rem;
      }
      .box-left{
        width: 2.5rem;
        height: 1.2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        span{
          margin-left: 0.12rem;
        }
      }
      .splitline{
        width: 0.01rem;
        background-color: #ebebeb;
        margin: 0 0.16rem;
      }
      .box-right{
        width: 2.5rem;
        height: 1.2rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        align-content: center;
        span{
          width: 100%;
          padding: 0.04rem 0;
        }
      }
      .box-bottom{
        width: 100%;
        margin: 0.16rem 0;
        display: flex;
        justify-content: center;

      }
    }
    .el-dialog {
      width: 7rem;
      // min-height: 100%;
      margin-top: 38vh !important;
      .el-dialog__header {
        
      }
      .el-dialog__title {
        font-size: 0.25rem;
        font-weight: bold;
        color: #333333;
      }
      .el-dialog__headerbtn {
        font-size: 0.25rem !important;
      }
    }
  }
}

</style>